<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:include="/common/header" />

<body>
    
    <section class="content-header">
        <h1>用户登录日志查看</h1>
    </section>
    <section class="content">
        <div class="box box-solid">
            <div class="box-body">
                <form id="searchbar" class="form-horizontal form-search">
                	<div class="form-group">
	                    <div class="col-md-12">
		                    <div class="pull-right">
		                        <button type="button" style="width:100px" class="btn btn-primary tonto-btn-search" onclick="table.refresh()"><i class="fa fa-search"></i>查询</button>
		                        <button type="button" style="width:100px" class="btn btn-default" onclick="$('#searchbar').resetSearch()"><i class="fa fa-repeat"></i>重置</button>
		                    </div>
		                </div>
	                </div>
                    <!-- 表单仅有一个text-input时回车会提交表单，这里添加一个无用的防止回车提交 -->
                    <input type="text" style="display:none">
                </form>
                <input type="hidden" id="pageLimit" th:value="${query?.limit}" />
                <input type="hidden" id="pageOffset" th:value="${query?.offset}" />
            </div>
        </div>
        <div class="box box-solid" style="margin-top:20px">
            <div id="result" class="box-body">
                <table id="dataGrid"></table>
                <div id="toolbar">
                    <div class="btn-group">
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div th:include="/common/footer" />
    <script type="text/javascript">
    var table;
    $(function() {
        initDataGrid();
    });

    function initDataGrid() {
        table = $.createTable("#dataGrid", {
            idField: "id",
            columns: [
                [
                	{ title: "登录账号", field: "account" },
					{ title: "IP", field: "ip" },
					{ title: "登录时间", field: "createTime", formatter:"datetime" }                
                ]
            ],
            url: '/common/sys/logger/login/find/page',
            searchbar: '#searchbar',
            showColumns: true,
            pagination: true,
            toolbar: "#toolbar",
            showRefresh: true
        });
    }

    </script>
</body>

</html>